var dtGridColumns = [/*{
    id: 'deviceFrontImg',
    title: '设备正前方照片',
    type: 'string',
    columnClass: 'text-center',
    headerStyle: 'color:grey; white-space:nowrap;'
},*/ {
    id: 'bigShelfNum',
    title: '大架子号',
    type: 'string',
    columnClass: 'text-center',
    headerStyle: 'color:grey; white-space:nowrap;'
}, {
    id: 'deviceFrontLiftImg',
    title: '设备左前照片',
    type: 'string',
    columnClass: 'text-center',
    headerStyle: 'color:grey; white-space:nowrap;'
}, {
    id: 'deviceFrontRightImg',
    title: '设备右前照片',
    type: 'string',
    columnClass: 'text-center',
    headerStyle: 'color:grey; white-space:nowrap;'
}, {
    id: 'deviceLiftAfterImg',
    title: '设备左后照片',
    type: 'string',
    columnClass: 'text-center',
    headerStyle: 'color:grey; white-space:nowrap;'
}, {
    id: 'deviceRightAfterImg',
    title: '设备右后照片',
    type: 'string',
    columnClass: 'text-center',
    headerStyle: 'color:grey; white-space:nowrap;'
},{
    id : 'operation',
    title : '操作',
    type : 'string',
    columnClass : 'text-center tpl-table-black-operation',
    headerStyle : 'color:grey; white-space:nowrap; padding: 0px 110px;',
    resolution:function(value, record, column, grid, dataNo, columnNo){ //此处的值（value）不直接显示
        var content = '';
        content += '<a href="#" onclick="loadPage(\'deviceImg/'+record.id+'/select\');"> <i class="am-icon-pencil"></i> 编辑</a> ';
        return content;
    }
}];

var dtGridOption = {
    lang: 'zh-cn',
    ajaxLoad: true,
    check: true,
    checkWidth: '37px',
    loadURL: 'deviceImg/list',
    columns: dtGridColumns,
    gridContainer: 'dtGridContainer',
    toolbarContainer: 'dtGridToolBarContainer',
    tools: '',
    pageSize: 10, //默认每页十条记录
    pageSizeLimit: [10, 20, 30] //分页选项：每页10、20\或者30条记录
};
var grid = $.fn.dlshouwen.grid.init(dtGridOption);
$(function () {
    grid.load();
    $('select').selected();
});

function search() {
    grid.parameters = new Object();
    grid.parameters['title'] = $("#title").val();
    grid.refresh(true);
}

function delteAll() {
    var checkId = getCheckAll(grid.getCheckedRecords());
    if (checkId != '') {
        del("deviceImg/" + checkId + "/deleteBatch", search);
    } else {
        layer.msg('请选择要删除的数据', {
            icon: 3
        });
    }
}

